/**
 * 删除一个排好序的链表的重复元素
 * @param {ListNode} head 
 */
var deleteDuplicates = function (head) {
    let current = head
    while (current !== null && current.next !== null) {
        // 若当前值=下一个的值，删除下一个
        if (current.val === current.next.val) {
            current.next = current.next.next
        } else {
            // 否则后移即可
            current = current.next
        }
    }
    return head
}